//
//  arrayGenerator.swift
//  sorting
//
//  Created by lhc on 2023/7/29.
//

import Foundation

class ArrayGenerator {
    static func generateRandomArray(n: Int, max: Int = 0) -> [Int] {
        var bound = 0
        if max == 0 {
            bound = n
        }else {
            bound = max
        }
        
        var l = [Int]()
        
        for _ in 1...n {
            l.append(Int.random(in: 0...bound))
        }
        return l
    }
    
    static func generateSortedArray(n: Int) -> [Int] {
        var l = [Int]()
        for i in 0..<n {
            l.append(i)
        }
        return l
    }
}
